import service from '@/api/index'

/**
 * 获取所有菜单列表
 */
export function getAuthList() {
  return service.post('/db/resource/listPage', {})
}

/**
 * 查询角色的菜单
 */
export function queryAuthByRoleId(roleId: string | number) {
  return service.post(`/db/resource/treeSelect`, { roleId })
}

/**
 * 添加菜单
 */
export function addAuth(data: any) {
  return service.post(`/db/resource/add`, data)
}
/**
 * 删除菜单
 */
export function delAuth(data: any) {
  return service.post('/db/resource/del', data)
}
/**
 * 修改菜单
 */
export function editAuth(data: any) {
  return service.post('/db/resource/edit', data)
}
